<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"/>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<title>Login_result</title>
<script>
function login(){
	location.href = 'Login.jsp';
}
function fail(){
	alert("아이디와 비밀번호를 확인해 주세요.");
	location.href = 'Login.jsp';
}
</script>

</head>
<body>

<jsp:useBean id="bean" class="member.Login" scope="page"/>
<!-- 폼태그에 있었던 모든 입력항목이 클래스 Login에 모두 전달됨. -->
<jsp:setProperty property="*" name="bean"/>
<div data-role='page' id='LoginMain' rel='external'>
<div data-role='header'><h1>로그인</h1></div>
<div data-role='content'>
<%
if(bean.login()){
	session.setAttribute("mid", bean.getMemberid());%>
	
	반갑습니다 <%=bean.getMemberid()%>님...
	<a href='index.jsp' data-role='button' data-ajax='false'>확인</a>
	<!-- <script>login();</script> -->
	
	
<% }else{%>
	아이디와 비밀번호를 다시 확인해주세요
	<a href='Login.jsp' data-role='button' data-ajax='false'>확인</a>
	<script>fail();</script>
<% }%>
</div>
<div data-role='footer'><h1>중앙 HTA</h1></div>
</div>


</body>
</html>